home *** CD-ROM | disk | FTP | other *** search
- Path: news.msn.com!news.compuserve.com
- From: ewl@panix.com (Emery Lapinski)
- Newsgroups: comp.lang.c
- Subject: Re: Help, best way to compare doubles
- Date: 16 Jan 1996 18:10:17 -0800
- Organization: Emery Lapinski, private citizen.
- Message-ID: <4dhlq9$82e@panix2.panix.com>
- References: <4da169$mm4@mercury.IntNet.net> <4dgnn5$em@news.microsoft.com>
- NNTP-Posting-Host: panix2.panix.com
- X-Forged-Path: I do not want my posts going to compuserve or msn
- X-SpookFood: [Hello to all my fans in domestic surveillance] arrangements colonel counter-intelligence terrorist
- X-ClamFood: OT VI OT VII KISSER NED FOR OTs COATES ScamIzDat
- X-CanterAndSiegel: Green Cards? Oxygenated Water? Hatred and disgust!
- X-Homepage: http://www.panix.com/~ewl/
-
- In article <4dgnn5$em@news.microsoft.com>,
- Dann Corbit <a-cnadc@microsoft.com> wrote:
- >In article <4da169$mm4@mercury.IntNet.net>, jtomich@IntNet.net says...
- >>
- >>Looking for a way to compare doubles for equality.
- >>
- >A very dangerous practice, as computing the same result two different
- >ways may not have exactly the same result. Sometimes a test such as:
- > abs( double1 - double2 ) < dEpsilon
- >is used, but this technique is not always valid. Suppose, for instance,
-
- You bet it's not always valid; abs() takes and returns an int.
- --
- ewl@panix.com | http://www.panix.com/~ewl | "You can have my useless cat(1)
- when you pry it from my cold dead finger(1)." | This work is Copyright 1995
- Emery Lapinski and is freely redistributable by anyone and anything with the
- exception of Microsoft Network. | Telco Bill, make a run for strong encryption.
-